Fixes for issues 1, 2, 5

Hello Jacob,

I've made some changes to address the issues below. I hope you will consider merging them.

#1 
#2 
#5 

Regards,
Ian Gibbs