fix nil ptr and fmt

I like your project, did some small stuff.