Fixed failing detect.js jasmine tests