* badchannels segfaults when there are no badchannels for next modules, fixed * added example badchannels * refactoring casting