Various fixes to problems on ARM

Various fixes to problems on ARM.