Updated and corrected critical bugs