Minor improvements
Improve error messages
Fix cmd_type for taststats