Fixed bugs and analysis errors