Fix a source of crashes: don't write out-of-bounds. Now also for prod.
Fix a source of crashes: don't write out-of-bounds.
Now also for prod.

zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb