Fix tests, incorporate jspam's advice