Core/Phases: some commenting, more cleanup and compile fix