Added support for multiple fences.