Added error messages to all reduction functions