fixed and improved spec coverage for befire/after callbacks