Implements system time and fixes bugs for FPGA.