Fixed a bug in log() when reset is empty.