Clean ups, Fixed Enviroment Detection