Fix 5.3 build and some small cleanups