Fixed and refactored tabs and some chat procs.