diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp
index ab95b0c57..37f954cb7 100644
--- a/core/subsurface-qt/DiveObjectHelper.cpp
+++ b/core/subsurface-qt/DiveObjectHelper.cpp
@@ -67,7 +67,7 @@ DiveObjectHelper::DiveObjectHelper(struct dive *d) :
 DiveObjectHelper::~DiveObjectHelper()
 {
 while (!m_cyls.isEmpty())
-    delete m_cyls.takeFirst();
+	delete m_cyls.takeFirst();
 }
 
 int DiveObjectHelper::number() const
@@ -267,8 +267,8 @@ QStringList DiveObjectHelper::cylinderList() const
 		}
 	}
 
-	for (i = 0; i < sizeof(tank_info) && tank_info[i].name != NULL; i++) {
-		QString cyl = tank_info[i].name;
+	for (unsigned long ti = 0; ti < sizeof(tank_info) && tank_info[ti].name != NULL; ti++) {
+		QString cyl = tank_info[ti].name;
 		if (cyl == EMPTY_DIVE_STRING)
 			continue;
 		cylinders << cyl;
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 871f93866..9de5ac1c8 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -844,7 +844,8 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q
 	// info for first cylinder
 	if (myDive->getCylinder() != cylinder) {
 		diveChanged = true;
-		int i, size, wp;
+		unsigned long i;
+		int size = 0, wp = 0;
 		for (i = 0; i < sizeof(tank_info) && tank_info[i].name != NULL; i++) {
 			if (tank_info[i].name == cylinder ) {
 				if (tank_info[i].ml > 0){