Minor fixes for bugs which can cause segfaults.
Fix spaces to tabs.