Debugged Unicorn mostly except for shutdown