Fix reference comparison