Cleanup in rules system and fixed bugs in some effects