Fixed a pretty critical bug.

Also added a basic ActiveRecord example.