Clean up code and attempt AltGr fix