Fixed an issue where the shouldExpand flag didn't work.

I think I did this right this time...