rules module updated and minor fixes