Upgrade to 5.4-beta-16 and fix compilation