Fix panic with sat16 mode without data buffer.
Remove some duplicate code.