Code fixes to get tests running