Fixed bug in which needed tasks for localhost would not be executed due to faulty `when` logic.