couple of fixes for mySqlConnector, minor refactoring in rulecontroller