Fixed extend function
Merge pull request #6 from cferdinandi/extend

Fixed extend function