Made it work with BSD