Cleaned and sped up the check command.