Fixed various issues, including prototype error on load. Closes #9.