Some Patches for upgrading