test block decoding, fix a handful of bugs