Fix +-1 memory allocation bug