Tqserver2

Code fixes after code review.