Added gzip compression to file saving, fixed saving bug.

Signed-off-by: Paul G <p.ganssle@gmail.com>