Introduing timestamped statements and fixing some bugs.