syncronised with PyLong v1.2.3.