Fixed bug in env parameter checking

Signed-off-by: Joakim Bech <joakim.bech@gmail.com>