Fix contextsAffected in "fireAfterSort" function