Improved equals checking.
Fixed Eclipse warning.
Merge branch 'feature/better_code' into develop