Added in_place option to merge_nodes

This is in relation to the discussion that happaned in #1100. After this is merged, I will make the appropriate changes in #1100 


Hmm, an annoying error! But understandable, since `max(None, 1)` is defined in Py2 but not Py3, so returning `None` would not be an option.

Anyway, can you add a test for this? I don't believe it's covered by current tests.