Improve error handling when --nodes option is passed