Make sure that 'code' is a string.