Fixed check for total number of scans in scanSync.m