more improvements to scandb.py