Fix some parsing issues. Add context around parse errors to err msg.