Properly show errors in batch compile mode

Fixes #578