Fixed few bugs in aleph.py code.