Bug fixes for rc4