XE16 updates

This set of commits makes this work on XE16 and XE16.11 and fixes a bug that caused a crash.