Fixed a path bug when running under Windows and refactored tests.