Issue #271 - Fixed potential NPE