Fix memory read out of array bounds thanks to valgrind, lower compression level temporarily, and add headers to makefile