more bug fixes across the board