fix formatting and a bug in clock_getres, and add unittest