buffer shim fixes and first tests