Fixed #5. Convert values to the provided type