Debuging deadlock
Fixed minor errors. Added panic.