Fixed nasty bug regarding os environment vars