Fixed hang on no input. Also improved environment system.

Calls to any env function will now automatically translate the
parameters into all caps.