Fixed bug in init