Bug fix, logging