Updated to 1.3.1 from source and cleaned up a bit