A few fixes for the ORM chapter

I've broken it down into separate commits for easier review.