Fix assertion messages in functional api