Bug fix for uninitialised pointers