Bugfix: SQL error, issue #141