Trim extra newlines at the end of the profile prototype.

Fixes #555.