Fix code and layout