Fix bad chunks when error occurs during message loading.