Added window.onload. Fixes #18