Fixing errors in initialization