more fixes, remove debug code