Fix warnings and errors for legacy build
Fix problems with code signing