Merge master bugfixes into BEF