#28 throw MaxDepthExceededException when max depth exceeded

See #28 for problem description.