Remove old unused methods and general cleanup
Quick fix for channel index problem

This patch 'fixes' the problem caused by using the channels array
indexs as the channel element id's (Removing a channel from the array
causes issues). Solves the problem by just setting the old channel
index to null.