Fixed a bug in getChannel (and removed some unused private variables)