general bug fixes and updates