Fix bug in clear method introduced in last change