small fixes to bam.lua for compiling on windows