Completed the functionality of set_options along with various small fixes to the other functions