This update corrects various bugs and brings parsing significantly closer to the official RFC and real-world logic. Please note that these changes will probably slightly alter permissiveness given that logic has changed - with some cases being more permissive and others being less, but in all cases the changes are all because of more correct behaviour.