Fixed a major security hole where it was possible to create new objects in some cases when you shouldn't be able to.