Add assertion to export code to make sure the buffer size hasn't changed somehow...