Fixed bugs with init()