Some bug fixing and panicing