those two places are where you will need to make the modifications. I did a quick test and the correct options are adding correctly.
The only difference i see between the change i made and the change you have is that my order by looks like this:
ORDER BY options.OptionID
ORDER BY OptionID
and similarly in the Products_Detail_Lookup.php file. Please trying making this change and let me know if it solves your issue.