added some fixes by Cyanogenmod team