Fixes to build behaviour