fixed build error on cw.cpp
fixed issues during termination of clockwork driver