Perhaps I'm being exceptionally thick this morning, but shouldn't you be using ne and eq rather than != and ==?