Update to 5.1.0 and use new macros