diff --git a/muttdown/config.py b/muttdown/config.py
index 236d16f..a09e9c7 100644
--- a/muttdown/config.py
+++ b/muttdown/config.py
@@ -80,6 +80,7 @@ class Config(object):
         if self._config['smtp_password'] and self._config['smtp_password_command']:
             raise ConfigError('Cannot set smtp_password *and* smtp_password_command')
         if self._config['css_file']:
+            self._css = None
             self._config['css_file'] = os.path.expanduser(self._config['css_file'])
             if not os.path.exists(self._config['css_file']):
                 raise ConfigError('CSS file %s does not exist' % self._config['css_file'])
@@ -101,6 +102,6 @@ class Config(object):
     @property
     def smtp_password(self):
         if self._config['smtp_password_command']:
-            return check_output(self._config['smtp_password_command'], shell=True).rstrip('\n')
+            return check_output(self._config['smtp_password_command'], shell=True, universal_newlines=True).rstrip('\n')
         else:
             return self._config['smtp_password']

diff --git a/tests/test_basic.py b/tests/test_basic.py
index 7f69017..1eb2df9 100644
--- a/tests/test_basic.py
+++ b/tests/test_basic.py
@@ -1,6 +1,8 @@
 from email.mime.text import MIMEText
 from email.mime.multipart import MIMEMultipart
 from email.message import Message
+import tempfile
+import shutil
 
 import pytest
 
@@ -15,11 +17,21 @@ def basic_config():
 
 
 @pytest.fixture
-def config_with_css(tmpdir):
-    with open('%s/test.css' % tmpdir, 'w') as f:
+def tempdir():
+    # workaround because pytest's bultin tmpdir fixture is broken on python 3.3
+    dirname = tempfile.mkdtemp()
+    try:
+        yield dirname
+    finally:
+        shutil.rmtree(dirname)
+
+
+@pytest.fixture
+def config_with_css(tempdir):
+    with open('%s/test.css' % tempdir, 'w') as f:
         f.write('html, body, p { font-family: serif; }\n')
     c = Config()
-    c.merge_config({'css_file': '%s/test.css' % tmpdir})
+    c.merge_config({'css_file': '%s/test.css' % tempdir})
     return c
 
 
diff --git a/tests/test_config.py b/tests/test_config.py
new file mode 100644
index 0000000..f5a040b
--- /dev/null
+++ b/tests/test_config.py
@@ -0,0 +1,27 @@
+import tempfile
+
+from muttdown.config import Config
+
+
+def test_smtp_password_literal():
+    c = Config()
+    c.merge_config({'smtp_password': 'foo'})
+    assert c.smtp_password == 'foo'
+
+
+def test_smtp_password_command():
+    c = Config()
+    c.merge_config({'smtp_password_command': 'sh -c "echo foo"'})
+    assert c.smtp_password == 'foo'
+
+
+def test_css():
+    c = Config()
+    c.merge_config({'css_file': None})
+    assert c.css == ''
+
+    with tempfile.NamedTemporaryFile(delete=True) as css_file:
+        css_file.write(b'html { background-color: black; }\n')
+        css_file.flush()
+        c.merge_config({'css_file': css_file.name})
+        assert c.css == 'html { background-color: black; }\n'

Error when trying to run gpg command as smtp_password_command
Hello, I've just switched machines and have been setting things up as I usually have them. I seem to be having an issue with the `smtp_password_command` parameter. My yaml file looks like this:

```yaml
smtp_host: smtp.gmail.com
smtp_port: 465
smtp_ssl: true
smtp_username: jack.lenox@gmail.com
smtp_password_command: gpg -d --no-tty /home/jacklenox/.passwd/gmail.gpg
```

But when I try to send an email, I get the following error.

```
Traceback (most recent call last):
  File "/home/jacklenox/.local/bin/muttdown", line 11, in <module>
    sys.exit(main())
  File "/home/jacklenox/.local/lib/python3.6/site-packages/muttdown/main.py",
line 169, in main
    conn = smtp_connection(c)
  File "/home/jacklenox/.local/lib/python3.6/site-packages/muttdown/main.py",
line 120, in smtp_connection
    conn.login(c.smtp_username, c.smtp_password)
  File "/home/jacklenox/.local/lib/python3.6/site-packages/muttdown/config.py",
line 104, in smtp_password
    return check_output(self._config['smtp_password_command'],
shell=True).rstrip('\n')
TypeError: a bytes-like object is required, not 'str'
```

If I replace `smtp_password_command` with the decrypted `smtp_password`, everything works fine. And if I try to run the GPG command on its own, equally everything works.

Any thoughts?
tests/test_config.py::test_smtp_password_command tests/test_config.py::test_css
tests/test_basic.py::test_unmodified_no_match tests/test_basic.py::test_simple_message tests/test_basic.py::test_with_css tests/test_config.py::test_smtp_password_literal