Your problem is probably the hysteresis in the comparator, this is what makes it a comparator, as opposed to a (not very linear) opamp.
Its hard to explain but basically it is slightly reluctant to change state. So to flip the output you need to go a little bit past equal voltages on the inputs. Maybe 10mv-30mv it should be on the datasheet.
Maybe an op amp would suit your purposes better. It is linear and has no hysteresis and as long as you dont use feed back it will go near to the rail.