improved checking for presence of module magic