small query fixes

remove an unneeded coma, use all bind values, otherwise psql goes nuts
add missing ;