fix wrong cast in test