Restore type checking in calc_thread_status()