Return a more helpful error message if an invalid refs path is provided

Fixes #240 and #242