Fix bugs in ActiveRecord recipe