fixed bug triggered by empty dirname in check_space

This was identified by acceptance tests, whoo.  Also addresses #359.