Correct syntax of allocate function

Fix mistaken syntax for use of allocate and restore original, very strange syntax.