SQL strict mode fixes. Closes #127