Fixed error handling, removed need to get tree