Fix crashes when no arguments or no input
fixing