Updates to be compatible with python 2.6 and numpy 1.5