Fixed some issues identified by FindBugs (dead stores, redundant null checks, etc)