CSV support improvements + various fixes