Fixed an error where shared memory was not set back to 0 in sparse connectivity with small models. Also cleaned up some more warnings.