Bug fixes in previous patch