More bug fixing in clear