Improve error reporting inside version blocks. Closes #666