Added tests for schema implementation.
Fixed parent and root algorithms.