UP-4524 patches

See: https://github.com/Jasig/uPortal/pull/428 for the merge into master.