Minor upgrade sql corrections

This resolves a couple upgrade problems I ran into when upgrading from 2.05.