Fix nearest size check in optimum, cleanup.