Merge back from develop

That whole file could use some work.