Add one-to-many, and fix some issues.