Fixed several bugs relating to 'check'