Integer casting workaround