General Bug fixes