Bug fixes for previous patch.