Fixes (thanks @mathewlenning)