Fix last channel doesn't go offline

Also fixes length init and invalid values for height& width of refresh
button.