Tidied permadeath code