Fixed problem with mixed class return type
Added tests