Bug fixes improvements