bug fixes and upgrade support