Bugfix in voting sql