bug fixes for release 4.0.5