Fixed compiling warnings, some taken from cyanogenmod repo