various bugfixes and csv upload
tiny cleanups