Fixed bugs in status checking