Fix bug where factory was altering prototype