Fixed a parsing issue with multiple links and images

Fixes #1 and also fixes a warning.