C&P my changes to avoid merge conflicts

Also my tab inserts a set number of spaces instead of 'tabs' now, hope
that doesn't ruin anything for anyone else.