Fix typo.
Move environment restriction to main entry point.