Min. length set to 1.
Replaced the stack allocator by dynamic memory using malloc().