Fixed errors in conditional