Fixed a bug where commands in PM caused a crash