Added TWstat msg support, fixed code style a bit