Fixed parsing issues in parse_options function

Would also suggest changing the percentage manipulation to 'toFixed(1)' instead of Math.ceil, just because you can get results that don't add up to 100% if everything is below .5 of a decimal place; but I've not added to this commit, since it's a debatable change!