bug fixes in initialization