Add logging and catch 'NoneType' errors

Also added a bat file which will conveniently pause so you can see any
errors before it exits.