Remove redundant cast to double.
Simplified code.
Cleanup of PMCommand.