Fixes to make aw work with SQL Server and Rails 3.2