Throw error if attempting to print directory

closes issue #2