Clarify error message when building in invalid dir.
Fix file removal. Closes gh-579.