Fixes bugs exposed by Crease29.