fix extend. Fixes #20