Lot of fixes. Implemented missing methods. Make it compile.