How is it attached and how to keep it from leaking?
It is the rectangular type with what appears to be a foam rubber gasket where it attaches to the tank.