Fix conversion error
Added some error checking for exposed functions