cleanups
bugfix for read
another fix for reader