cython: raise error when accessing irrelevant data in diet mode
python: fix bugs in test.py & test_lite.py