Fixed ordering of when before wraps.