Fixes #5 #6 #7 issues