Added EOF as a valid close to a block; trailing whitespace shouldn't cause problems.