Modified Middleware to support command-line specification of RM's.