Fix compiler options not getting into program build
Fix free scanner object without veryfing if it wasn't NULL
Scan kernel must be given element and sum types