Merge "Handle sample rate out of bound correctly." into tm-dev