Fix Issues #11 #12 #13

Fixes #11, Fixes #12, Fixes #13