Port some commits from mainline lk