Fix previous commit

Crash on shutdown caused by missing managed/unmanaged declarations.