Optimizations of code.

This commit includes also a missing test which checked if
handling of Transient attribute is implemented properly.