Fix prototypes

fixes #10 

fixes #9 

started #8 

fixes #5