Add %global detection. Partialy fix for issue #9.