Bug fixes.
Add reference.
Add indexes.