Small fixes and new remotefile function