Change max and fix alloc.