Rework the behavior of the PartialFrameHandler and fix a lot of bugs