Fixed a null reference error and added a channel count.