Fixed ValueError that occurs when heap_size is 0