Use log.Fatal instead of panic

Simplify assignment of file handle