Clean up a Map iteration (switch from iterating keys to iterating entries).

Found by findbugs. Thank you, findbugs!