Fixed some issues with update queries.