(fix) Removed use of deprecated constructors and other bad practices.

Fixes several small issues and unnecessary allocations and makes the tests clearer.