Added more input filtering.