some bug fixes/path handling