Cast heading subelements to allow for operations.. Fixes #212

It may be more appropriate to change the function return type.