Warn if sample frequency too short. Fix some timing issues.