Clean up some Linux warnings.
Add range check to clock frequency.