Fix extend

This solves #554