Environment and errors fix