Fix buf in DofMap::dofs().

Not sure whether it should return globals DOFs
but definitely it was uncorrect before.
Slight optimization of DofMap::dofs()
Fix typo in DofMap::dofs()
Get rid of unnecessary cast in DofMap::dofs().
Merge branch 'blechta/fix-issue-342'