bug fixes for uninitialised values