Fixed saving to buffer