fix bugs for compile demo.mp in FreeBSD 10.1