Fixed clearCache. closes #534.