smdb.py: fix some crashing bugs