Fixed testing logic