Add position validations

it's weird to see a bare elsif. I'm guessing it's using the next line as the condition, but I'm not actually certain. I'd put the condition on the same line as the elsif if you have to have it.