fixed padding bug in Writer. Updated license to reflect Go-derived code