Shebang and other fixes