JJ: small fixes to work on debian wheezy (python2.7 only)