Kangedpicked commits from CM review part 3#

http://review.cyanogenmod.org/#/c/52033/

Thanks to the original author OliverG96