various fixes to get things working