Making plugin work on FreeBSD, removing Linux dependencies