Issue 617: Reset index back to zero if indexOfSlash is less than zero.

Should solve the issue when indexOfSlash is less than zero causing layouts not to inflate.   This was reported in issue  617.