More fixes for critical bugs