Fixed newline at end of file to please the evil compiler
Fixed memory free for friend in wrong location