fix for len() function, see #1