diff --git a/flatland/envs/rail_env.py b/flatland/envs/rail_env.py
index b4a56a8d241a4a1d6706ff67bad6030ce619ebf0..abc8a738355dbf19bf08cf6a55f088166537dec1 100644
--- a/flatland/envs/rail_env.py
+++ b/flatland/envs/rail_env.py
@@ -231,7 +231,7 @@ class RailEnv(Environment):
                 self.rewards_dict[iAgent] += stop_penalty
 
             if not agent.moving and not (action == RailEnvActions.DO_NOTHING or action == RailEnvActions.STOP_MOVING):
-                # Only allow agent to start moving by pressing forward.
+                # Allow agent to start with any forward or direction action
                 agent.moving = True
                 self.rewards_dict[iAgent] += start_penalty
 
@@ -270,6 +270,7 @@ class RailEnv(Environment):
                             else:
                                 # TODO: an invalid action was chosen after entering the cell. The agent cannot move.
                                 self.rewards_dict[iAgent] += invalid_action_penalty
+                                self.rewards_dict[iAgent] += step_penalty * agent.speed_data['speed']
                                 agent.moving = False
                                 self.rewards_dict[iAgent] += stop_penalty
 
@@ -277,6 +278,7 @@ class RailEnv(Environment):
                         else:
                             # TODO: an invalid action was chosen after entering the cell. The agent cannot move.
                             self.rewards_dict[iAgent] += invalid_action_penalty
+                            self.rewards_dict[iAgent] += step_penalty * agent.speed_data['speed']
                             agent.moving = False
                             self.rewards_dict[iAgent] += stop_penalty