Aded <init> method and some fixes for compiler