Reworked RiffWriter