Issue #27. Fix for the NPE problem.