Small changes to condition checking logic