updates and general bug fixes