Fix for HashMap out of order bug raised by Rohan Mathure