Fixed minor issue with the compare func