Fix constant propagation for extract function