bugfix for using buffer-equal. we need unit tests.