first tests and bug fixes