Account for more type conversion possibilities, add tests to cover most cases