Merge pull request #185 from siena123/master

fix bugs #472 and #462
cleanup, fixes and raw sql removed
Merge pull request #200 from vomikan/master

cleanup, fixes and raw sql removed
Fix MSVC compiler warnings.
Merge pull request #202 from stef145g/master

Fix MSVC compiler warnings.