Fixing 'allocate' method