fix known hosts and add tests for get dir and version