It looks like it works.  Just know that you can specify the extension in headfits() with ext=#