Fixed ugly errors