1. Remove cast linecount to number, it causes problems and appears no longer necessary
2. Remove commented out sections