Fix incorrect cast.
Add a basic 'main' to get some actual function.