Activity recognition fixes