diff --git a/flightlog.py b/flightlog.py
index b079d30a..295b972b 100644
--- a/flightlog.py
+++ b/flightlog.py
@@ -56,7 +56,7 @@ def export(data):
         time.strftime('%H:%M:%S', time.localtime(querytime)),
         data['lastSystem']['name'],
         data['commander']['docked'] and data['lastStarport']['name'] or '',
-        ship_map.get(data['ship']['name'], data['ship']['name']),
+        ship_map.get(data['ship']['name'].lower(), data['ship']['name']),
         ','.join([('%d %s' % (commodities[k], k)) for k in sorted(commodities)])))
 
     logfile.flush()
diff --git a/outfitting.py b/outfitting.py
index fc390baf..5c5629f7 100755
--- a/outfitting.py
+++ b/outfitting.py
@@ -227,7 +227,7 @@ def lookup(module):
         name = module['name'].lower().rsplit('_', 2)	# Armour is ship-specific, and ship names can have underscores
         new['category'] = 'standard'
         new['name'] = armour_map[name[2]]
-        new['ship'] = ship_map.get(name[0], name[0])
+        new['ship'] = ship_map[name[0]]		# Generate error on unknown ship
         new['class'] = '1'
         new['rating'] = 'I'