Added some fixes to subjet calculation.