adding freebsd compatibility
make ostype detection case insensitive