fix bam.lua for windows and os x