Fixed logging code.