Fix for issue #11. The problem was I forgot to add operator= for variable pattern on references.