Fix misplaced code