Fix exception handling with new VCS backend

Closes #534

Signed-off-by: Michal Čihař <michal@cihar.com>
Merge branch 'master' into bootstrap