NPE bug fix, this time for real!