Fix some ugly errors