Fixed issue with type inference for types that are convertible to and from eachother.

Fixes the issue in #281/#282