Fixed code generation for extension loading which produced warnings in release build.