fix pathmapper and escaping bugs