Fixes from @havocp's review