various fixes to make it work