TST: Added test for Piecewise fix. Also fixed formatting error in new code.