Fix collection path integrity check

Fix the directory check to make sure the user specified a valid directory instead of a path to a file.
Originally implemented in 3a2c7e9 of #386