256 total slots, not 255.
g_max_mem is now the count of memory slots, not the number of the highest (zero-based) slot.