Fixed a problem with logic in CA