Fix memory leak.
Remove global ivars and add singleton for key mapping.
Create locale after for cycle.