[fix] add `type` to before and after to grab correct `passes`, fixes #537

@cronopio we could probably use some tests for adding functions before/after any of the passes. 

cc @yawnt