Code cleanup #2, doc blocks added, fixed tab disconnection behavior…