Remove dynamic use of 'extend'. Fixes #225