mx.security.rms() - bugfixes / refactoring