Fixes for Typed Params

this fn extracted from $state.registerState()