Fix http://tracker.modx.com/issues/8221