Fixed crash with missing or empty inputs