Fixes #240

However, I would like to do a more thorough review of file types, so no pull req yet.