Fix predicate arities and add script to check them.