Fixed non-existent memory issue and added performance counters.