Fix merge conflicts

Import changes from master.