Merged 4.0 newish features into 4.1