Test case and goleveldb fix (fixes #740, fixes #796)