Implement --check. Fixes #102