Fixed bug with environment check. For real this time.