Improve handling apostrophes

Thanks to @RichardHitt