Changed replacing of defines. Fixes #4