Replaced call to deprecated mark_context_dirty.

Method was deprecated at version 2013111800 so have added a check to choose between deprecated version and new version.