Some fixes to get the code compile

Partially fix #2.