Added tests for applybase (copied from bh)