Fixed issues with empty rules