fix some typing and defaulting issues