emit less type casts
cleanup some tests
check files