Fixed bug when upgrading empty maxgrade (reported by Ferran Recio - UPCnet)