Fix 'max_buffer is not defined' error