some typer fixes and tests