It turns out that .equals() doesn't work too well on nulls. Fixed that NPE