Fixed #7. Fixed Uncaught TypeError