Fixes for STL memory issues, took a long time to track these down. Implemented wrapper functions for read only calls from maps