Generic signature translations

Here is fix for third case from #504. Now it is fully fixed. I also added first test case, because it now also passes.