Cherrypicked the fix to building for deploy