Added path separator and fixed some bugs.