avision: Fix issues found by code inspection
These are apparent issues that were found by code inspection. They need confirmation from someone else who has a scanner that uses this backend.
In addition to these, note that there are some parts of !19 (merged) that do not seem quite right; see the questions I have raised there.
Edited by Ralph Little