os.c: Fixed a few errors with button handling