fixed init
fixed bugs for the tests