minor bugfixes across the board