Remove use of deprecated APIs

Also, add a spec.
Why is this `waits` needed?