Added handling of empty models