Fixed issue #106, SQL error