peaks fix to work on older scipy versions