Fixes in type management