Fixed #389: Providing negative value to memory allocation function.