Merged changes made by leseratte

Merged the changes made by leseratte and made some of my own. This
should possibly be enough to get Mario Kart Wii to login but I do not
have a way to test it myself.