The rattling sound is probably the water sensor float. It's plastic and slides up and down on a shaft, if I remember correctly.
So it sounds like you replaced the ENTIRE fuel filter and WIF assembly. Those are 2 separate pieces. Suggest that you make sure there's a good seal between them. Again, if I remember, there is a rather fat doughnut seal between the 2 pieces. It does not go around the perimeter but is located in the center. I don't remember if there is another separate gasket that seals the edge between them or not.
* Make sure there's only one 'doughnut' between the 2 pieces.
I've been away from these for a while now. Really need someone who replaces their own fuel filters to chime in to address the number and location of these gaskets.
Tim