Fix NPE on bags