Fix transformation between different types