Fixes numerous bugs and restores features lost in the PC port.