Issue 348

I added quoting for the csv file output and added/changed some tests. This should solve #348.