Fix wrong type returned