Fix for "function is not needed and will not be emitted" errors