Make test numerically stable
Closes #107