Fixed path handling and added new tests.