Minor Error fixes and cleaning.