Fixed bugs in devise & panic