Bug fix for mysql error in new trunk