Fixed problem with empty channels and undefined arrays