Improved filename passing and other stuff.