Fixed some more bugs, made the upgrade system work.