fixes from https://github.com/franciscofranco/LG-P500-2.6.35-re-write/commit/60815cfa3ea1520d62413c4ea8a394c500f2b066