Add shebang lines and fix lineno formatting