fixed bug in series expansion