Fix bugs and add options feature