fixed some minor BOM bugs and enhanced docs