Fixing a bug in nested types resolution