Fix bug in testing