fixed port defaults and type check