Fix for undefined max-width (replaces #18)

I rewrote pull request #18 to be against the unstable branch so it can be merged. This also fixes issue #29.