Fixed bug in sparse weight test.