fix option handling and string to int conversion