simplify "if (p) free(p)"
spelling fixes and tab expansion
run astyle
Merge pull request #50 from RhysU/master

Minor hygiene