fix some hints found by Android Studio code inspection
fix object comparison
Merge pull request #1017 from cascheberg/fix-analysis

@cascheberg fix some hints found by Android Studio code inspection