Added clipboard handling and improved working with attached files.