Implement max_shape() correctly by taking into account the shared argument, if one exists.
Implement max_shape() correctly by taking into account the shared argument, if one exists.

Fixes #25

egaburov/agency,egaburov/agency