Fix tests

Commit 6bed45d switched detection code to use libmagic, which somehow caused failures on testcases. This will fix a few test case failures.