Add test tool; clean up unused variables