* Fix accidental buffer free before transfer * Refactored code to eliminate a bunch of warnings * Updated copyright headers