general bug fixes