tensor tests ported + fixed stupid mistake in adjust_term