Fix duplicate icon. Fix some SQL bugs.