Fix bug were type definitions were not being cached