Fixes #319. This only fixes the most common case.