Fix muladdmod and also fix scalar decomposition