Minor code cleanup
Iterate over a QHash directly rather than creating a temporary container from keys().
Guard against using an out of range index into a QString.
Iterate over a QHash directly rather than creating a temporary container from keys().
Guard against using an out of range index into a QString.