Fix bug in testing library