Assorted bugfixes

New thread is fixed and Thread.php is fixed to show proper UI to users
not logged in