Fixed bugs; added options