Merge "Fix some problems with moving in and out of detached state." into honeycomb-mr2