fix BadLocationException, tiny syntax fixes