Fixed equation error and comparison error