Bugfix: junk getting written at the start of output
Initial support for key signing