Added if statement to build tree if input has attribute tree. fixes #98.