more type inference fixes