Fix some problems with conversion