Add some checks on input (see JIRA item ROOT-6890)