Added hash authentication, other fixes