Clean up CustomPages and fix a couple bugs