small changes to detection,
fixes for tracking from Hongyi