Fix NullPointerException with empty header cells