fixed wrong data_maximum calcluation; prevent out-of-buffer in exp_bef