Implemented fromDOM and various bug fisex for official tests