add test for failed pre-upgrade

Cleaned up some unused variables as well.