Fixed lookup by descriptor instead of name. Added simple test case.