Fix for stub platform and get working on FreeBSD