fixed assertion and empty line at file ending