First implementation of TreeField + other fixes