omit dead assignment for #332
a bit of refactoring
fix some tests for #224
fix a bug slightly related to local type tests
a small improvement for #224