Fix pivoting
Merge pull request #2 from andreasnoackjensen/fixlm

Fix pivoting