Disable scan optimization if no scan given

Addresses segmentation fault issue in #69