CORE-5002: fixed an SQL error and added the zone to three more functions