cleanup, fixes, adjust tests