fix bad typing and use of