Make switches more customizable. Fix #553.