Improving integer check in up function.