fix upgrade timeouts (cache problem), add some memoization debugging. fixes #146