Add locale change handler; fix bugs