Validate directory argument. Fixes #11.