Improve URI parsing and update specs