Fix comparison

Fix for bug 587