Adding tests for vscan, fixing bugs