Fixed wrong dict key messing up csvwriter