Misplaced endif