Improve extend method
Merge pull request #34 from igorbronowicki/extend_fix

Improve extend method