SQL case fixes and 1 proc fix
Merge pull request #35 from wriley/sqlfixes

SQL case fixes and 1 proc fix