Made the check for a message key in hashes (i.e. #package_key.message_key#) more robust by only recognizing it if both parts, separated by a ".", exists.
This reduces the odds of random text between hashes being mistaken for a key and throwing a "missing key" error.