Fixed an infinite loop on Capacitor#run_for