Bug fixes & BAM related fixes & removing rat

Bug fixes & BAM related fixes & removing rat