ms-sbvar: corrected bug in initialization/computation of final subperiod

(cherry picked from commit ed15f0bcac24a9c0bdf7c59dea6f152c7b306cd1)
ms-sbvar: corrected bug in initialization/computation of final
subperiod

(cherry picked from commit 1ddd00b502007e2640fcb48e64fc651f42abb46e)