Fix CSV method to work with Python 3