Bug fixes in Bot_core