Bug fixes and COM support