Fix some issues with new build system