Revert "Fix hwclock script. Minor other changes."

This reverts commit 0931252f85a36dcc9e78748b038d14eee3d39c90.
Resolved conflict