Cleaned up the power-up code.