Fix build script for core