Fixed critical bugs.