Fixed failing to delay on some systems and displaying unnecessarry error messages on others 

Fixed not delaying because of varying window id lengths, and displaying error messages on some systems without xdotool.
Tested on Ubuntu 14.04 x64