Improved integer comparison, added suorting direction for sync and added
support for non autocommit connections.