#1 Add checks, Fix crash on empty container