fixes #550
Merge pull request #781 from paglias/master

set prototype.constructor when overwriting prototype