fixing some busted stuff and better logging