Fix a bug of wrong type