Fixed divide by zero error on allocation of size 0