Fixes Issues 176
Fixed some MySQL specific bugs
Merge branch 'issue-176'