Annoying length() bug