Clean up a few file and socket related checks