fixed some dirty options processing code