improved cli backtrace
fix for bug that got triggered in rare situations
bunch of bug fixes