Merge loos' patches