Fixed general errors in some conditions