fixed scripts for BSD