Update and correct few vars and funcs names