fix some checks for empty inputs