Added math extension to shell input
Fixed case when a command sends multiple shutdown signals resulting in paralel contexts beeing created