Changed how paths are handled as well as some minor bugfixes