cleaned source a bit more, forgot to close file in heap dump routine