bug fixes, turned tests green