Fixed key not present in dictionary bug.