checks on input, other clean-up