Update bam.lua to work with Mac OS X