Move some final phase changes to more appropriate places