FIXED - Final part was not havning end() called correctly in all cases.