Fix test_ensure_num_units