Fixed bug when using unique query for scm.