Fix #301 Flexible Instances, and a bug in type instance lookup