Fixed bug with initialization