Fix convert function

Shawn: I know you said you might have a different fix for this but I am putting it up there in case you want to use this.