Fix Bug #185 - Tree is now more intellegent in Ajax

Also Improvments for #187