Fixes for #7, #8 and #9

Hi Giorgos,

This pull request includes the fixes for issues #7, #8 and #9.

Regards,
Duncan