improved optional arg checking for 'window.Bugle'