rpc_mapproject: Reduce memory usage and crashes, put check