Separate allow_gc flag for scan

This add a separately configurable flag to enable/disable allow_gc