Imported changes from Carbonbass production version