Make more check in render to always apply the correct behaviour for the
Before/After parameters.