Fixed bugs in the hold mode and clock generation