Bug with serialization the timestamps

Sometimes I get an error like value does not respond to 'length'. I'm adding a conditional before doing so, and, if not, then I convert it to a String. Now it doesn't fail.