Fixed issue with method with sealed class return type