Fixed population of database from srg file.

Added tests for cache map.