Fix bad order of declarations