Better error handling + Better definition of udefine environment
Updated dist JS