Fixed compiler warning (unix)
Fixed segfault on FreeBSD (unix)