Fixes to get all tests working (in browser). Still has issues running on the console.