Fixed comparison functions