- corrected errors found with valgrind
- fixed linux compile errors