Updated to better handle the different test types.