Fix path handling exceptions resulting from wrong module use