Fix condition in series.
Unnecessary variable p1 was deleted.
Calculate power of two on fly.
Merge remote-tracking branch 'origin/bbpopt'