Backported fixes for 1.4.1 and fixed a few more little things I noticed.