Fixed bugs in sparse contractions.