Filter out empty input elements