Fixed upgrade bug and cleared whitespace.