Fixed Core::count() to work with collections