1) set up default gap for group studies
2) change missing to is.null for gap's control flow
change missing to is.null for hgap's control flow