Use log.Panic instead of panic and small fix