Fix clean build
Previously it only worked because there was some leftover artifacts from previous builds. This also fix the remaining compiler warnings