Fix profile stats

This should fix the issue #113, but I haven't tested with Python versions other than 2.7.5+.