Catch an for malformed pathspecs. Add a few tests.