- more general bugfixes (not all upgrade values were being used in the code)