Fix bug in definePrototype