Finally fixed an annoying bug caused by an uninitialised pointer being returned