Fixed critical errors