Added missing checkInputs() and helper function from master.