General fixes and passing tests