am a91d00b4: Many fixes to detached mode

# Via Vikram Aggarwal
* commit 'a91d00b4de3092b41af5f36436d3b49fe4586f64':
  Many fixes to detached mode