Fixed bug with conditions.