Remove asserts, close file descriptors (we do not want to leak them in plugin detection phase)