Fix one assignment before use and remove duplicate call to libmagic