Added a small helper function to make type conversion nicer.