Fix a couple more instances of non-PostgreSQL friendly SQL