fix reflection code, add tests