Refactored MX(Sparsity,val), #983
Removed usage of deprecated functions (6), #983