Bugfix: variables not initialized leading to undefined behaviour