Fix deploy bug and make direct algorithm run