merged latest upstream patches from cm repo