Fixing NPE in helpers