Final (hopefully) sample rate API + misc fixes