Fixed generic parameter in inner classes (#352)

I've resolved second problem from #352 (generic parameter) and added some sort of test for both problems. I'm not very happy with tests, but it is better then nothing.