Fixed bug where tests might be executed twice or more