Fixing document equality

Was not handling None