Fixed an error in family trigger replacement.

Closes #333.