Fix some small coding problems in direct search