Changes from advanced stock kernel

Thanks to DooMLoRD