Bug fixes and support for segments.