Minor performance improvements for chain