Fix crash on initialization