Added mouse hook and minor improvements