Make --check-requirements conditional, and some code cleanups