Corrected guard variable comparison