Avoid some possible NullPointerExceptions (using short circuit && correctly and adding forgotten 'else' keyword)
Merge pull request #8 from jhrcek/NPEFixes

Avoid some possible NullPointerExceptions