Fixes critical errors