minor fixes, error handling

added some error handling so Nimphina is happy, and made sure the file
name doesn't include .txt (program adds that by default)