Minor improvements. Add logging