Fixed newphase
Some more fixes and comments