Fix observer comparisons

Updated version of pull request #35 against current master, with the fix I suggested in the comments.