Removed a log message that could trigger an InvalidMemoryOperationError.
Removed unused variable.