Replace incorrect jQuery.size() method