Fixed handling of empty input