Fixed pushing glitches, some code cleanup