Fix code to follow coding guidelines