cmd_getval() will attempt to read 'val' as a string. If 'val' happens to be an integer, we will end up with an empty 'val'. In this particular case we also wouldn't have 'n' initialized with the actual value. Maybe there's some function that allows us to grab the string representation of a value -- let me check that and get back to you.