Updated sqlite database and patched time tracking functions