>Numerics coming from results of say val() have decimal portion. Use int() as you did or alternatively you can use "set decimals to 0".
Ok, make senses but I still don't understand why this behavior is not constant. When it starts doing it, it will do it for a while. Then, it will work.