add switch to bam to compile for 32 bit
fixed bug in PM system