Fix deprecation warnings; use shared_examples in specs