Changed the std::map::at calls into std::map::find, because the former seems not to be supported by Microsoft VS2008