Fixes #18 by not setting window.location unless href is defined