Compilation fix for null pointer in constructor