Added warnings.
Added shut down error code.
removed a retain cycle.