bug fixes with pstotal.py