Fix issue with perl 5.18 in sub list_scan.
Minor updates
Minor syntax errors