Fixed #150 - Add error handling code to avoid writing empty value to the
attribution file
Some comments clean up