Add tests for expm balancing issue (#5151)