Fix a bug and modify log levels