Fixed timestamp bug, added test state update func.