Improve filemap perf by 2-4X and add more error handling