changes for 4.0 and fixes for 4.1