isolated uptime2str() to be able to use it from different graph than 'system'
fixed the use of an uninitialized value
some improvements