diff --git a/python-api-src/library.cpp b/python-api-src/library.cpp
index c1c0dc0192e86f89ec678649b35aa3822e5cd6f4..c868e9f561551180ee14bf0d5a34a7b7d8dea1f5 100644
--- a/python-api-src/library.cpp
+++ b/python-api-src/library.cpp
@@ -64,24 +64,24 @@ PYBIND11_MODULE(library, m)
 
     // IDABot is a specialization of Agent
 	py::class_<IDABot, PyIDABot, sc2::Agent>(m, "IDABot")
-		.def(py::init())
-		.def("on_game_start", &IDABot::OnGameStart)
-		.def("on_step", &IDABot::OnStep)
-		.def("get_all_units", &IDABot::GetAllUnits, "Returns a list of all units")
-		.def("get_my_units", &IDABot::GetMyUnits, "Returns a list of all units beloning to the player")
-		.def("get_player_race", &IDABot::GetPlayerRace)
-		.def_property_readonly("base_location_manager", &IDABot::Bases)
-		.def_property_readonly("tech_tree", &IDABot::GetTechTree)
-		.def_property_readonly("map_tools", &IDABot::Map)
-		.def_property_readonly("building_placer", &IDABot::GetBuildingPlacer)
-		.def_property_readonly("start_location", &IDABot::GetStartLocation, "CCPosition representing the start location")
-		.def_property_readonly("minerals", &IDABot::GetMinerals, "How much minerals we currently have")
-		.def_property_readonly("current_supply", &IDABot::GetCurrentSupply, "How much supply we are currently using")
-		.def_property_readonly("max_supply", &IDABot::GetMaxSupply, "How much supply we can currently use")
-		.def_property_readonly("gas", &IDABot::GetGas, "How much gas we currently have")
-		.def("use_ability", &IDABot::CallUnitCommand, "Use an ability with the given unit")
-		.def("use_ability", &IDABot::CallUnitCommandWithPoint, "Use ability at point with the given unit")
-		.def("use_ability", &IDABot::CallUnitCommandWithTarget, "Use ability at target with the given unit");
+        .def(py::init())
+        .def("on_game_start", &IDABot::OnGameStart)
+        .def("on_step", &IDABot::OnStep)
+        .def("get_all_units", &IDABot::GetAllUnits, "Returns a list of all units")
+        .def("get_my_units", &IDABot::GetMyUnits, "Returns a list of all units beloning to the player")
+        .def("get_player_race", &IDABot::GetPlayerRace)
+        .def_property_readonly("base_location_manager", &IDABot::Bases)
+        .def_property_readonly("tech_tree", &IDABot::GetTechTree)
+        .def_property_readonly("map_tools", &IDABot::Map)
+        .def_property_readonly("building_placer", &IDABot::GetBuildingPlacer)
+        .def_property_readonly("start_location", &IDABot::GetStartLocation, "CCPosition representing the start location")
+        .def_property_readonly("minerals", &IDABot::GetMinerals, "How much minerals we currently have")
+        .def_property_readonly("current_supply", &IDABot::GetCurrentSupply, "How much supply we are currently using")
+        .def_property_readonly("max_supply", &IDABot::GetMaxSupply, "How much supply we can currently use")
+        .def_property_readonly("gas", &IDABot::GetGas, "How much gas we currently have")
+        .def("use_ability", &IDABot::CallUnitCommand, "Use an ability with the given unit")
+        .def("use_ability", &IDABot::CallUnitCommandWithPoint, "Use ability at point with the given unit")
+        .def("use_ability", &IDABot::CallUnitCommandWithTarget, "Use ability at target with the given unit");
 
     py::class_<sc2::PlayerSetup>(m, "PlayerSetup");
 
diff --git a/src/IDABot.cpp b/src/IDABot.cpp
index 5a7b4dd305309e1422956bb7169e8d4c6abb90df..d504496e299c309a29b682bee55563f93442120d 100644
--- a/src/IDABot.cpp
+++ b/src/IDABot.cpp
@@ -219,17 +219,17 @@ const TypeData & IDABot::Data(const MetaType & type) const
 	return m_techTree.getData(type);
 }
 
-void IDABot::CallUnitCommand(const Unit* unit, sc2::AbilityID ability)
+void IDABot::CallUnitCommand(const Unit& unit, sc2::AbilityID ability)
 {
-	Actions()->UnitCommand(unit->getUnitPtr(), ability, false);
+    Actions()->UnitCommand(unit.getUnitPtr(), ability, false);
 }
 
-void IDABot::CallUnitCommandWithPoint(const Unit* unit, sc2::AbilityID ability, const sc2::Point2D& point)
+void IDABot::CallUnitCommandWithPoint(const Unit& unit, sc2::AbilityID ability, const sc2::Point2D& point)
 {
-	Actions()->UnitCommand(unit->getUnitPtr(), ability, point, false);
+    Actions()->UnitCommand(unit.getUnitPtr(), ability, point, false);
 }
 
-void IDABot::CallUnitCommandWithTarget(const Unit* unit, sc2::AbilityID ability, const Unit* target)
+void IDABot::CallUnitCommandWithTarget(const Unit& unit, sc2::AbilityID ability, const Unit* target)
 {
-	Actions()->UnitCommand(unit->getUnitPtr(), ability, target->getUnitPtr(), false);
+    Actions()->UnitCommand(unit.getUnitPtr(), ability, target->getUnitPtr(), false);
 }
diff --git a/src/IDABot.h b/src/IDABot.h
index 7578bef16c572f42da1fc98b204f11eb1e77a3ae..9d79f954d7eb571b98360425aca4215e6c5426cb 100644
--- a/src/IDABot.h
+++ b/src/IDABot.h
@@ -63,8 +63,8 @@ public:
     const TypeData & Data(const MetaType & type) const;
     const TypeData & Data(const Unit & unit) const;
 
-	// Used for giving "raw" commands to units
-	void CallUnitCommand(const Unit* unit, sc2::AbilityID ability);
-	void CallUnitCommandWithPoint(const Unit* unit, sc2::AbilityID ability, const sc2::Point2D& point);
-	void CallUnitCommandWithTarget(const Unit* unit, sc2::AbilityID ability, const Unit* target);
+    // Used for giving "raw" commands to units
+    void CallUnitCommand(const Unit& unit, sc2::AbilityID ability);
+    void CallUnitCommandWithPoint(const Unit& unit, sc2::AbilityID ability, const sc2::Point2D& point);
+    void CallUnitCommandWithTarget(const Unit& unit, sc2::AbilityID ability, const Unit* target);
 };