a couple of fixes and some additions for 4.0.4