- fixed issue with writing bits from the wrong end in some cases