Fixed some code. Added get_presence function.