improve input padding near EOF