More patches from BS12:master